<cfparam name="showPrintable" default="0">
<cfparam name="form.fromname" default="">
<cfparam name="form.fromemail" default="">
<cfparam name="form.name" default="">
<cfparam name="form.email" default="">
<cfparam name="form.message" default="">
<cfparam name="form.submit" default="">
<cf_JelCMS_Menu	navId = "#navId#"
					datasourcename = "#datasourcename#">
<cf_JelCMS_Header	navId = "#navId#"
					datasourcename = "#datasourcename#"
					directoryPathToTemplates = "#directoryPathToTemplates#">		
<cf_JelCMS_Footer	navId = "#navId#"
					datasourcename = "#datasourcename#"
					directoryPathToTemplates = "#directoryPathToTemplates#">


<cfscript>
	inWorkshops = false;
	currentParentId = listFirst(parentIdList);
	if (listLen(parentIdList) gt 1) {
		currentParentId = listGetAt(parentIdList, 2);
		if (currentParentId eq 5) {
			inWorkshops = true;
		}
	}
</cfscript>

<cfset passedCaptcha = false>
<cfif not isDefined("form.captcha")>
	<cfset passedCaptcha = true>
<cfelse>
	<cfif lcase(form.captcha) eq session.captchatext>
		<cfset passedCaptcha = true>
	<cfelse>
		<cfset passedCaptcha = false>
	</cfif>
</cfif>

<cfif len(form.submit) and passedCaptcha>
	<cfquery name="SaveAnnouncementSignUp" datasource="#datasourcename#">
		insert into SPREAD_THE_WORD (
			STW_FROMNAME,
			STW_FROMEMAIL,
			STW_NAME,
			STW_EMAIL,
			STW_MESSAGE,
			STW_IP
		) values (
			<cfqueryparam value="#form.fromname#" cfsqltype="CF_SQL_VARCHAR">,
			<cfqueryparam value="#form.fromemail#" cfsqltype="CF_SQL_VARCHAR">,
			<cfqueryparam value="#form.name#" cfsqltype="CF_SQL_VARCHAR">,
			<cfqueryparam value="#form.email#" cfsqltype="CF_SQL_VARCHAR">,
			'#reReplaceNoCase(htmlEditFormat(form.message), "'", "&rsquo;", "ALL")#',
			<cfqueryparam value="#cgi.remote_addr#" cfsqltype="CF_SQL_VARCHAR">
		)
		
		select @@IDENTITY as signupId
	</cfquery>
	
	<cfmail to="#form.email#" from="#form.fromemail#" subject="Spread the word!" type="HTML">
		<p>Hello, #form.name#</p>
		<p>This is an email from #form.fromname# who'd like to let you know about Calgrants.org!</p>
		<p>
			<strong>Their message:</strong><br>
			#htmlEditFormat(form.message)#
		</p>
		<hr>
		
		<p>Be sure to check out our <a href="http://#http_host#/index.cfm?navid=1&ref=#SaveAnnouncementSignUp.signupId#">Home Page</a></p>
		<p>Or view our <a href="http://#http_host#/index.cfm?navid=5&ref=#SaveAnnouncementSignUp.signupId#">Workshops section</a>.</p>
	</cfmail>

	<cflocation url="/index.cfm?navid=164" addtoken="No">
</cfif>


<cfoutput>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
	<html>
	<head>
		<title>#ClientName# - Spread the Word</title>
		<link rel="stylesheet" href="/common/styles.css">
		<link rel="stylesheet" href="#urlPathToStyleSheet#">
		<script language="javascript" src="/common/scripts.js"></script>
		
		<script language="JavaScript" src="/common/dhtml.js"></script>
		<link href="/common/dhtml.css" rel="stylesheet">
		
		<cfif inWorkshops>
			<link rel="stylesheet" href="/common/workshops.css">
		</cfif>
	</head>
	<cfparam name="onloadProcs" default="">
	<body onLoad="doLoadProc();#onloadProcs#">
		<div id="hideDhtml" onmouseover="hideLayer('hideDhtml'); delayedNavHide();">
			<a href="javascript:void(0);" onmouseover="hideLayer('hideDhtml'); delayedNavHide();"><img src="/common/images/spacer.gif" width="99%" height="99%" border="0" alt="" galleryimg="no"></a>
		</div>

		<div class="main">
			<table border="0" cellpadding="0" cellspacing="0" class="mainTable">
				<tr valign="top">
					<td class="contentColumn">
						<cfif not showPrintable>
							<cfif Len(header.fileName) gt 0>
								<cfinclude template="#CFMapping_Root#/templates/#header.fileName#">
							</cfif>
						</cfif>

				
						<div class="contentContainer">
							<table border="0" cellpadding="0" cellspacing="0">
								<tr valign="top">
									<td class="subnav">
										<cfinclude template="/common/subnav.cfm">
										<img src="/common/images/spacer.gif" width="184" height="1" alt="" border="0"><br>
									</td>
									<td class="content">
										<p class="pageTitle"><img title="A Cash for College workshop will assist you in filling out the FAFSA application." height="72" alt="A Cash for College workshop will assist you in filling out  the FAFSA application." src="/common/images/workshops-subbar.gif" width="543" border="0"></p>
										<p class="pageTitle">Spread the Word</p>
										
										<p>Some content here? Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat.</p>
										
										<cfform action="#script_name#?navid=#navid#" method="POST" enablecab="Yes">
											
											<cfif not passedCaptcha>
												<span class="errorMessage">We're sorry. The validation code entered doesn't match.</span>
											</cfif>
											
											<div class="gradientBox" style="padding-left: 10px; padding-right: 10px; padding-top: 6px;">
												<table border="0" cellpadding="2" cellspacing="0" width="515">
													<tr>
														<td>* Your Name:</td>
														<td><cfinput class="formField" type="Text" name="fromname" message="Your Name is required" required="Yes" value="#form.fromname#"><br></td>
														<td align="right">* Required Field<br></td>
													</tr>
													<tr>
														<td>* Your E-mail:</td>
														<td><cfinput type="Text" name="fromemail" message="Your E-mail is required" value="#form.fromemail#" validate="email" required="Yes" visible="Yes" enabled="Yes" showautosuggestloadingicon="True" typeahead="No" class="formField"><br></td>
													</tr>
													<tr>
														<td>* Friend's Name:</td>
														<td><cfinput class="formField" type="Text" name="name" message="Friend's Name is required" required="Yes" value="#form.name#"><br></td>
													</tr>
													<tr>
														<td>* Friend's E-mail:</td>
														<td><cfinput type="Text" name="email" message="Friend's E-mail is required" validate="email" value="#form.email#" required="Yes" visible="Yes" enabled="Yes" showautosuggestloadingicon="True" typeahead="No" class="formField"><br></td>
													</tr>
													<tr valign="top">
														<td>Message:</td>
														<td>
															<cftextarea name="message" value="#form.message#" rows="4" cols="20"></cftextarea><br>
														</td>
													</tr>
													<tr valign="top">
														<td>* Type the code shown:</td>
														<td>
															<cfinput type="Text" name="captcha" message="Please enter the validation code." required="Yes" visible="Yes" enabled="Yes" showautosuggestloadingicon="True" typeahead="No" class="formField"><br>
															<img src="/common/getCaptchaImg.cfm" border="1" alt=""><br>
														</td>
													</tr>
													<tr valign="top">
														<td colspan="2">&nbsp;</td>
													</tr>
													<tr valign="top">
														<td colspan="2"><cfinput type="Submit" name="submit" value="Submit" visible="Yes" enabled="Yes"></td>
													</tr>
												</table>
											</div>
										</cfform>
									</td>
								</tr>
							</table>
						</div>

						<img src="/common/images/spacer.gif" width="744" height="1" alt="" border="0"><br>
				
						<cfif not showPrintable>
							<cfif Len(footer.fileName) gt 0>
								<cfinclude template="#CFMapping_Root#/templates/#footer.fileName#">
							</cfif>
						</cfif>
					</td>
					<td class="extraColumn">
						<img src="/common/images/bg/ds-corner.gif" width="11" height="14" alt="" border="0"><br>
					</td>
				</tr>
			</table>
		</div>
		
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-1152673-1";
urchinTracker();
</script>

	</body>
	</html>
</cfoutput>
